package com.erp.remote.information;

import com.erp.entity.information.ProviderCategory;
import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@RequestMapping("/information/providerCategory")
public interface ProviderCategoryRemote {

    @RequestMapping("/allCategory")
    AjaxResult getAllProviderCategory();


    @PostMapping("/selectProviderCategoryByCompanyId")
    AjaxResult selectProviderCategoryByCompanyId(@RequestParam("companyId") Integer companyId);


    @PostMapping("/selectProviderCategoryByCompanyIdPage")
    AjaxResult selectProviderCategoryByCompanyIdPage(@RequestBody Map<String, Object> params);

    /**
     * 根据客户分类的的名称查询数据，含companyId
     * @param params
     * @return
     */
    @RequestMapping("/getProviderCategoryByDescription")
    AjaxResult getProviderCategoryByDescription(@RequestBody Map<String,Object> params);


    /**
     * 修改时选择可用的父类别
     * @param companyId
     * @return
     */
    @PostMapping("/selectAvailableParentCategories")
    AjaxResult selectAvailableParentCategories(@RequestParam("currentId") Integer currentId, @RequestParam("companyId") Integer companyId);
    /**
     * 添加用户类别
     * @param providerCategory
     * @return
     */
    @PostMapping("/addProviderCategory")
    AjaxResult addProviderCategory(@RequestBody ProviderCategory providerCategory);


    @RequestMapping("/checkProviderCategoryOnly")
    AjaxResult checkProviderCategoryOnly(@RequestParam("providerKindCode") String providerKindCode);


    /**
     * 启用客户分类
     * @param params
     * @return
     */
    @PostMapping("/enableProviderCategory")
    AjaxResult enableProviderCategory(@RequestBody Map<String,Object> params);

    /**
     * 禁用客户分类
     * @param params
     * @return
     */
    @PostMapping("/disableProviderCategory")
    AjaxResult disableProviderCategory(@RequestBody Map<String,Object> params);

    @PostMapping("/updateProviderCategory")
    AjaxResult updateProviderCategory(@RequestBody ProviderCategory providerCategory);
}
